package com.loveprogrammer.redismq.listener.handler.impl;

import com.loveprogrammer.redismq.annotation.Listeners;
import com.loveprogrammer.redismq.annotation.MQListener;
import com.loveprogrammer.redismq.listener.handler.BaseHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @ClassName TestHandler
 * @Description
 * @Author admin
 * @Date 2023/10/16 11:17
 * @Version 1.0
 */
@Component
@Listeners(topic = "test")
public class TestHandler extends BaseHandler {
    private static final Logger logger = LoggerFactory.getLogger(TestHandler.class);

    @MQListener(tag = "execute",messageClass = String.class)
    public Boolean execute(String key, String message) {
        logger.info("test-入参是字符串:{}" ,message);
        return Boolean.TRUE;
    }

    @MQListener(tag = "execute2",messageClass = Integer.class)
    public Boolean execute2(String key, Integer number) {
        logger.info("test-入参是数字:{}" ,number);
        return Boolean.TRUE;
    }
}
